package com.smart.sms.config;

import com.aliyun.dysmsapi20170525.Client;
import com.aliyun.teaopenapi.models.Config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.annotation.Resource;

/**
 * LTAI5tK9Hd9PJeLLwwioP7xF
 * rPFisRtL8hVyyVACGdyMCl5ceUJyNk
 */
@Configuration
public class AliSmsConfig {
    @Resource
    AliSmsConfigProperties configProperties;

    @Bean
    public Client createClient() throws Exception {
        Config config = new Config();
        config.setAccessKeyId(configProperties.getAccessKeyId());
        config.setAccessKeySecret(configProperties.getAccessKeySecret());
        config.endpoint = configProperties.getEndpoint();
        return new Client(config);
    }
}
